
from django.shortcuts import render_to_response,HttpResponse
import datetime
# Create your views here.

def index(request):
	userlist = [
			{'username':'test','address':'usa','favor':'renyao'},
			{'username':'test1','address':'usa1','favor':'renyao1'},
			{'username':'test2','address':'usa2','favor':'renyao2'},

	]
	info = {
			2222:['al',23,11],
			3333:['al1',24,12],
			4444:['al2',25,13]

	}

	return render_to_response('includes/current.html',locals())
def index2(request):
	return HttpResponse('hello word!! +++hello word!! ')

def get_time(request,year):
	c_time = str(datetime.datetime.now())
	str1 = '.....%s time./ %syesr...' % (c_time,year)
	return HttpResponse(str1)

def time_plus(request,plus_hour):
	print 'Recevice argument:' ,plus_hour
	c_time = datetime.datetime.now()
	# assert False 
	return HttpResponse("curren time is:%s....%s" % (c_time,plus_hour))

def get_name(request,name):
	return HttpResponse('you name is :%s' % name)

def get_info(request,name):
	return HttpResponse('going to info for: %s' % name)

def index_html(request):
	name_dic = {
			2222:['al',23,11],
			3333:['al1',24,12],
			4444:['al2',25,13]

	}
	name_list = ['123','hello','12345','123456']
	name_var = 'hello'
	return render_to_response('index.html',{'info':name_dic,'c_time':datetime.datetime.now(),'name_list':name_list,'name_var':name_var})
	

	